package com.stylefeng.guns.modular.netcar.warpper;

import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper;
import com.stylefeng.guns.core.util.SpringContextHolder;
import com.stylefeng.guns.modular.netcar.dao.LineCityZoneMapper;
import com.stylefeng.guns.modular.netcar.model.LineCityZone;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

/**
 * 部门列表的包装
 *
 * @author fengshuonan
 * @date 2017年4月25日 18:10:31
 */
public class LineRangePriceWarpper extends BaseControllerWarpper {

    private LineCityZoneMapper lineCityZoneMapper= SpringContextHolder.getBean(LineCityZoneMapper.class);

    public LineRangePriceWarpper(Object list) {
        super(list);
    }

  @Override
  public void warpTheMap(Map<String, Object> map) {
        String lczId = (String) map.get("lczId"); // 区域
        if (StringUtils.isNotBlank(lczId)) {
            LineCityZone lineCityZone=lineCityZoneMapper.selectById(lczId);
            if(lineCityZone!=null)
                map.put("lczName", lineCityZone.getLczName());
        }
    }
}
